package org.scirp.ijmis.dao.personpaper.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.scirp.ijmis.dao.base.impl.BaseDAOImpl;
import org.scirp.ijmis.dao.personpaper.IResearchFieldOfPaperDAO;
import org.scirp.ijmis.po.personpaper.ResearchFieldOfPaper;

public class ResearchFieldOfPaperDAOImpl extends BaseDAOImpl<ResearchFieldOfPaper> implements IResearchFieldOfPaperDAO {
	private static final String className=ResearchFieldOfPaperDAOImpl.class.toString();
	@Override
	public boolean deleteResearchFieldOfPaper(ResearchFieldOfPaper researchFieldOfPaper) {
		return super.deleteObject(researchFieldOfPaper, className+"-->deleteResearchFieldOfPaper(ResearchFieldOfPaper researchFieldOfPaper)")==null?false:true;
	}

	@Override
	public boolean deleteResearchFieldOfPaperByPaperId(Long paperId) {
		String hql="delete from ResearchFieldOfPaper where paperId=:paperId";
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("paperId", paperId);
		return super.ExecuteNonQuery(hql, map, className+"-->deleteResearchFieldOfPaperByPaperId(Long paperId)");
	}

	@Override
	public boolean saveResearchFieldOfPaper(ResearchFieldOfPaper researchFieldOfPaper) {
		return super.saveObject(researchFieldOfPaper, className+"-->saveResearchFieldOfPaper(ResearchFieldOfPaper researchFieldOfPaper)")>0?true:false;
	}

	@Override
	public List<ResearchFieldOfPaper> selectAll() {
		String hql="from ResearchFieldOfPaper order by pid desc";
		return super.ExecuteQuery(hql, className+"-->selectAll(");
	}

	@Override
	public ResearchFieldOfPaper selectById(long id) {
		return super.selectById(id, className+"-->selectById(");
	}

	@Override
	public List<ResearchFieldOfPaper> selectByPaperId(long paperId) {
		String hql="from ResearchFieldOfPaper where paperId=:paperId";
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("paperId", paperId);
		return super.ExecuteQuery(hql, map, className+"-->selectByPaperId(Long paperId)");
	}

	@Override
	public boolean updateResearchFieldOfPaper(ResearchFieldOfPaper researchFieldOfPaper) {
		return super.updateObject(researchFieldOfPaper, className+"-->updateResearchFieldOfPaper(ResearchFieldOfPaper researchFieldOfPaper)");
	}

}
